﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace CommandLine
{
    public class FolderComparer
    {
        private string m_Folder;

        public FolderComparer(string mFolder)
        {
            m_Folder = mFolder;
        }

        public string MFolder
        {
            get { return m_Folder; }
        }

        public List<string> GetCodeFiles()
        {
            List<string> filePath = new List<string>();
            DirectoryInfo dir = new DirectoryInfo(m_Folder);
            foreach (var fsi in dir.GetFileSystemInfos())
            {
                if (fsi is FileInfo)
                {
                    FileInfo fi = (FileInfo) fsi;
                    if (fi.Extension == ".cpp" || fi.Extension == ".txt")
                    {
                        filePath.Add(System.IO.Path.GetFullPath(fi.FullName));
                    }
                }
            }

            return filePath;
        }
    }
}
